<template>
  <el-dialog title="提示" :visible.sync="centerDialogVisible" width="30%" center    :close-on-click-modal="false">
    <el-select v-model="value" placeholder="请选择" style="margin-left:80px;margin-bottom:20px;" @change="handleChange" >
      <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item" value-key="'label'"></el-option>
    </el-select>
    <component :is="componenName" @handleSub="handleSub"></component>
  </el-dialog>
</template>

<script>
import fromone from "./fromone";
import fromtwo from "./fromtwo";
export default {
  components: {fromone,fromtwo},
  data() {
    return {
      centerDialogVisible: false,
      options: [
        {
          value: "1",
          label: "不带权限的",
          name:'fromone'
        },
        {
          value: "2",
          label: "带权限的",
          name:'fromtwo'
        }
      ],
      componenName: "fromone",
      value: ""
    };
  },
  methods:{
    handleSub(params){
        console.log(params,'c参数')
    },
    handleChange(a){
       this.componenName = a.name
    }
  }
};
</script>
